Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1

来源:百度知道 编辑:UC知道 时间:2024/07/07 08:55:03
Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1
我的是JSP环境,
http://localhost:1000/xiaoyu/update.jsp?name=realName&value=小鱼
value=中文英文就出错,为数字就正常的
String name=request.getParameter("name");//获得字段名
name=new String(name.getBytes("ISO8859-1"),"gb2312");

String value=request.getParameter("value");
value=new String(value.getBytes("ISO8859-1"),"gb2312");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String updatexiaoyuinfo="update xiaoyu set "+name+"="+value+"" ;
stmt.executeUpdate(updatexiaoyuinfo);out.print("更新成功");

你在执行stmt.executeUpdate()之前输出一下updatexiaoyuinfo这条SQL语句,看一下你的sql语句的内容是否已经完整。

而且你的句子,可能存在问题。
String updatexiaoyuinfo="update xiaoyu set "+name+"='"+value+"'" ;
可以尝试一下。

http://www.escdns.com